import { request } from '@/framework/utils/request-jdz';

/**
 * @description 获取自定义的表单
 * @param {LoginParams} data
 * @returns
 */
export function getcustomerFormData(params?) {
  return request<any>(
    {
      url: '/common/cfg/specimen_fields',
      method: 'get',
      maxRedirects: 0,
      params,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

//下载图片
export const downloadFile = (id) => {
  return request(
    {
      url: '/file/download/' + id,
      method: 'get',
      responseType: 'arraybuffer',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 上传附件
export const billAttachment = (data) => {
  return request(
    {
      url: '/bill-in/attachment',
      method: 'post',
      data: data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 上传文件
export const uploadFile = (data) => {
  return request(
    {
      url: '/file/upload',
      method: 'post',
      data: data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
export const billOutAttachment = (data) => {
  return request(
    {
      url: '/bill-out/attachment',
      method: 'post',
      data: data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 样本核销-核销-底单存单-高拍仪-上传附件
export const billVerifyAttachment = (data) => {
  return request(
    {
      url: '/bill-verify/attachment',
      method: 'post',
      data: data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
// 样本盘点-盘点-高拍仪-上传附件
export const billInventoryAttachment = (data) => {
  return request(
    {
      url: '/bill-inventory/attachment',
      method: 'post',
      data: data,
    },
    {
      isGetDataDirectly: false,
    },
  );
};
